package cn.com.service.impl;

import java.util.List;

import cn.com.dao.WebDao;
import cn.com.pojo.Person;
import cn.com.service.TransactionRun;

public class TransactionRunImpl implements TransactionRun {
	private WebDao webDao;

	public WebDao getWebDao() {
		return webDao;
	}

	public void setWebDao(WebDao webDao) {
		this.webDao = webDao;
	}

	@Override
	public void run() {
		Person person = new Person();

		person.setName("事务");
		person.setDesc("事务处理");
		webDao.addPerson(person);
		System.out.println(webDao.getPersonsCount());
//		System.out.println(webDao.getPersonName(Integer.MAX_VALUE));

		List<Person> list = webDao.selectAllInfo();
		for (Person p : list) {
			System.out.println("name : " + p.getName());
		}

	}

}
